﻿
<button type="button" class="btn btn-success" id="PutByFormQuery">PutByFormQuery</button>
<script type="text/javascript">
    $(() => {
        $("#PutByFormQuery").click(function () {
            let body = new FormData();
            body.append('name', 'tom')
            body.append('age', '18')
            fetch('/api/HttpVerb/PutByFormQuery?id=15', {
                method: 'PUT',
                mode: 'cors',
                cache: 'no-cache',
                headers: {
                    appkey: 'appkey12345',
                    appsecret: 'appsecrte12345',
                    sign: 'sign12345',

                    'content-type': 'application/x-www-form-urlencoded; charset=utf-8'
                },
                body: 'name=tom&age=18'
            })
                .then(response => response.json())
                .catch(error => console.error('Error:', error))
                .then(response => console.log(JSON.stringify(response)))
                .catch(error => console.error('Error:', error));
        });
    });
</script>